diff options
| author | Factiven <[email protected]> | 2023-10-24 20:27:32 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-10-24 20:27:32 +0700 |
| commit | 451e4dffd000169e7113aa3275e4acaf7f1fbbbc (patch) | |
| tree | 035edf0d05e2f6878be745c326935aba3d821636 /pages/api/v2/episode/[id].js | |
| parent | Update v4.2.1 (diff) | |
| download | moopa-4.2.2.tar.xz moopa-4.2.2.zip | |
Update v4.2.2v4.2.2
Diffstat (limited to 'pages/api/v2/episode/[id].js')
| -rw-r--r-- | pages/api/v2/episode/[id].js | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/pages/api/v2/episode/[id].js b/pages/api/v2/episode/[id].js index 029d131..ea511e6 100644 --- a/pages/api/v2/episode/[id].js +++ b/pages/api/v2/episode/[id].js @@ -4,8 +4,8 @@ import appendMetaToEpisodes from "@/utils/appendMetaToEpisodes"; let CONSUMET_URI; -CONSUMET_URI = process.env.API_URI; -if (CONSUMET_URI.endsWith("/")) { +CONSUMET_URI = process.env.API_URI || null; +if (CONSUMET_URI && CONSUMET_URI.endsWith("/")) { CONSUMET_URI = CONSUMET_URI.slice(0, -1); } @@ -96,13 +96,7 @@ async function fetchConsumet(id) { async function fetchAnify(id) { try { - if (!process.env.API_KEY) { - return []; - } - - const { data } = await axios.get( - `https://api.anify.tv/episodes/${id}?apikey=${API_KEY}` - ); + const { data } = await axios.get(`https://api.anify.tv/episodes/${id}`); if (!data) { return []; @@ -138,7 +132,7 @@ async function fetchCoverImage(id, available = false) { } const { data } = await axios.get( - `https://api.anify.tv/content-metadata/${id}?apikey=${API_KEY}` + `https://api.anify.tv/content-metadata/${id}` ); if (!data) { |